#!/usr/bin/env python
# -*- coding:utf-8 -*-
import sys
import time
# for i in range(10):
#     sys.stdout.write("\r%s" %i)
#     sys.stdout.flush()
#     time.sleep(0.3)

recv_size=0
total_size=100
# last_progress=0
while True:
    progress_num=recv_size*100/total_size
    # new_progress=progress_num-last_progress
    sys.stdout.write("\r%s%%"%progress_num)
    sys.stdout.flush()
    time.sleep(0.1)
    # last_progress=progress_num
    recv_size+=1
    if progress_num>=100:
        break
